package com.zc.chapter423.controller;


import com.zc.chapter423.utils.ResultGenerator;
import com.zc.chapter423.vo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/api/hello")
public class HelloController {

    //http://localhost:8088/api/hello/say?name=AOP
    @GetMapping(value = "/say")
    public Result<String> say(@RequestParam String name){
        int a = 2;
        int b = 0;
        int c = a / b;
        System.out.println(c);
        return ResultGenerator.ok("Hello, " + name +c);

    }




    /*@ExceptionHandler(Exception.class)
    public Result exceptionHandler(){
        return ResultGenerator.fail();
    }*/
}
